-- GENERATED SPELL FOR [Duyash the Cruel] --


function spell0_20390(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(15284,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20390', 623, 1)
end

function spell1_20390(pUnit, Event) --@Frightening Shout,n/a--
pUnit:FullCastSpellOnTarget(19134,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20390', 6279, 1)
end

function spell2_20390(pUnit, Event) --@Mortal Strike,n/a--
pUnit:FullCastSpellOnTarget(16856,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20390', 5252, 1)
end

function spell3_20390(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(15589,pUnit)
pUnit:RegisterEvent('Sorts_20390', 561, 1)
end

function spell4_20390(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(13736,pUnit)
pUnit:RegisterEvent('Sorts_20390', 2000, 1)
end

function Sorts_20390(pUnit, Event)
local choix_sorts_20390 = math.random(0, 4)
if choix_sorts_20390 == 0 then
pUnit:RegisterEvent('spell0_20390', 1, 1)
end
if choix_sorts_20390 == 1 then
pUnit:RegisterEvent('spell1_20390', 1, 1)
end
if choix_sorts_20390 == 2 then
pUnit:RegisterEvent('spell2_20390', 1, 1)
end
if choix_sorts_20390 == 3 then
pUnit:RegisterEvent('spell3_20390', 1, 1)
end
if choix_sorts_20390 == 4 then
pUnit:RegisterEvent('spell4_20390', 1, 1)
end
end

function mob20390_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20390', math.random(1500, 3000), 1)
end

function mob20390_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20390_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20390_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20390, 1, 'mob20390_Action')
RegisterUnitEvent(20390, 2, 'mob20390_Leave')
RegisterUnitEvent(20390, 3, 'mob20390_Kill')
RegisterUnitEvent(20390, 4, 'mob20390_Die')
